package test1230pm;

public class Test03 {
    public static void main(String[] args) {
        // (3)设计一个公司类和员工类
        // 场景：员工张三在IBM公司工作、员工李四在HP公司工作
        // 要求：根据需求创建员工和公司对象、并能表示出员工和公司之间的关联关系、打印员工以及所在公司的信息
        Gs IBM = new Gs("我是IBM","IBM");
        Gs HP = new Gs("我是HP","HP");
        Yg zhangSan = new Yg("张三",IBM);
        Yg liSi = new Yg("李四",HP);
        System.out.println(zhangSan);
        System.out.println(liSi);

    }
}
 class Gs{
    String gsname;
    String gsmessage;
     public Gs() {
     }

     public Gs(String gsmessage , String gsname) {
         this.gsmessage = gsmessage;
         this.gsname = gsname;
     }

     public String getGsname() {
         return gsname;
     }

     public void setGsname(String gsname) {
         this.gsname = gsname;
     }

     public String getGsmessage() {
         return gsmessage;
     }

     public void setGsmessage(String gsmessage) {
         this.gsmessage = gsmessage;
     }

     @Override
     public String toString() {
         return "Gs{" +
                 "gsname='" + gsname + '\'' +
                 ", gsmessage='" + gsmessage + '\'' +
                 '}';
     }
 }
 class Yg{
     String ygname;
     Gs gs;
     public Yg() {}

     public Yg(String ygname, Gs gs) {
         this.ygname = ygname;
         this.gs = gs;
     }

     public String getYgname() {
         return ygname;
     }

     public void setYgname(String ygname) {
         this.ygname = ygname;
     }

     public Gs getGs() {
         return gs;
     }

     public void setGs(Gs gs) {
         this.gs = gs;
     }

     @Override
     public String toString() {
         return "Yg{" +
                 "ygname='" + ygname + '\'' +
                 ", gs=" + gs +
                 '}';
     }
 }
